﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace KanaLearn
{
    public partial class Settings : Form
    {
        public Settings()
        {
            InitializeComponent();
            checkBox1.Checked = Hiragana.a;
            checkBox2.Checked = Hiragana.b;
            checkBox3.Checked = Hiragana.c;

            checkBox4.Checked = Katakana.a;
            checkBox5.Checked = Katakana.b;
            checkBox6.Checked = Katakana.c;
            checkBox7.Checked = Katakana.d;
        }

        private void Settings_Closing(object sender, CancelEventArgs e)
        {
            if (!checkBox1.Checked && !checkBox2.Checked && !checkBox3.Checked)
            {
                MessageBox.Show("Hiragana: Musisz wybrać przynajmniej jedną opcję");
                checkBox1.Checked = true;
            }
            if (!checkBox4.Checked && !checkBox5.Checked && !checkBox6.Checked && !checkBox7.Checked)
            {
                MessageBox.Show("Katakana: Musisz wybrać przynajmniej jedną opcję");
                checkBox4.Checked = true;
            }
            //hiragana - ustawienia
            if (checkBox1.Checked) Hiragana.a = true;
            else Hiragana.a = false;
            if (checkBox2.Checked) Hiragana.b = true;
            else Hiragana.b = false;
            if (checkBox3.Checked) Hiragana.c = true;
            else Hiragana.c = false;
            // katakana - ustawienia
            if (checkBox4.Checked) Katakana.a = true;
            else Katakana.a = false;
            if (checkBox5.Checked) Katakana.b = true;
            else Katakana.b = false;
            if (checkBox6.Checked) Katakana.c = true;
            else Katakana.c = false;
            if (checkBox7.Checked) Katakana.d = true;
            else Katakana.d = false;
        }
    }
}